package com.ky.gp.app.controller;


import com.ky.common.vo.R;
import com.ky.gp.app.service.FollowFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * --- 天道酬勤 ---
 *
 * @author 1379
 * @date 2024/6/22
 * @desc -- 代码敲烂 月薪过万--
 */
@RestController
@RequestMapping("/api/course")
public class FollowController {

    @Autowired
    private FollowFeign followFeign;


    /**
     * 关注功能
     * @param followingId
     * @return
     */
    @GetMapping("/followUser")
    public R followUser(@RequestParam("followingId") Integer followingId) {
        return followFeign.followUser(followingId);
    }


    /**
     * 取消关注用户
     * @param followingId
     * @return
     */
    @GetMapping("/unfollowUser")
    public R unfollowUser(@RequestParam("followingId") Integer followingId) {
        return followFeign.unfollowUser(followingId);
    }

    /**
     * 取消关注教师
     * @param followingId
     * @return
     */
    @GetMapping("/unfollowTeacher")
    public R unfollowTeacher( @RequestParam("followingId") Integer followingId) {
        return followFeign.unfollowTeacher(followingId);
    }

    /**
     * 关注教师
     * @param followingId
     * @return
     */

    @GetMapping("/followTeacher")
    public R followTeacher( @RequestParam("followingId") Integer followingId) {

        return followFeign.followTeacher(followingId);
    }

    /**
     * 关注文章
     * @param followingId
     * @return
     */

    @GetMapping("/followArticle")
    public R followArticle( @RequestParam("followingId") Integer followingId) {
        return followFeign.followArticle(followingId);
    }


    /**
     * 取消关注文章
     * @param followingId
     * @return
     */
    @GetMapping("/unfollowArticle")
    public R unfollowArticle( @RequestParam("followingId") Integer followingId) {
        return followFeign.unfollowArticle( followingId);
    }
}

